//package com.kira.scaffoldmvc.Disruptor;
//
//import com.lmax.disruptor.RingBuffer;
//import com.lmax.disruptor.dsl.Disruptor;
//import com.lmax.disruptor.util.DaemonThreadFactory;
//
//// 1. 定义事件类 - 承载数据的容器
//class LongEvent {
//    private long value;
//
//    public void set(long value) {
//        this.value = value;
//    }
//
//    public long get() {
//        return value;
//    }
//}
//
//// 2. 定义事件工厂
//class LongEventFactory implements com.lmax.disruptor.EventFactory<LongEvent> {
//    @Override
//    public LongEvent newInstance() {
//        return new LongEvent();
//    }
//}
//
//// 3. 定义事件处理器
//class LongEventHandler implements com.lmax.disruptor.EventHandler<LongEvent> {
//    @Override
//    public void onEvent(LongEvent event, long sequence, boolean endOfBatch) {
//        System.out.println("Event: " + event.get());
//    }
//}
//
//// 4. 定义事件生产者
//class LongEventProducer {
//    private final RingBuffer<LongEvent> ringBuffer;
//
//    public LongEventProducer(RingBuffer<LongEvent> ringBuffer) {
//        this.ringBuffer = ringBuffer;
//    }
//
//    public void onData(long value) {
//        // 获取下一个序列号
//        long sequence = ringBuffer.next();
//        try {
//            //